package com.powersystem.demo.mapper;

import com.powersystem.demo.entity.PsUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import javax.lang.model.element.NestingKind;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author linrongji
 * @since 2019-11-14
 */
public interface PsUserMapper extends BaseMapper<PsUser> {
    @Select("SELECT ROLEID FROM PS_USER WHERE open_id = ${openId} ")
    public int fetchUserRole(@Param("openId") String openId);
    @Select("SELECT * FROM PS_USER WHERE roleId =${roleId}")
    public List<PsUser> selectByRoleId(@Param("roleId")int roleId);
    @Select("SELECT * FROM PS_USER WHERE  USERNAME  LIKE '%${username}%' AND  userstatus = ${userstatus}")
    public List<PsUser> selectByuserNameAndUserStatus(@Param("username")String username,@Param("userstatus")int userstatus);


}
